package cc.yugu.yhdw.common.domain.basic;

import cc.yugu.yhdw.common.annotation.Transient;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 顾客，客户信息
 *
 * @Date:Created in 2018/6/27 9:09
 * @Author:
 * @Modified By: zxj 2018/6/27 9:09
 */
public class Passport extends PassportInfo {

    // 新增：客户启用状态枚举
    public enum Status {
        ENABLE(1, "启用"),
        DISABLE(0, "禁用"),;

        private final int value;
        private final String name;

        private Status(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer,String> map = new HashMap<Integer, String>();

        static {
            for (Status e : Status.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    String password; //密码
    String portrait; //头像
    Integer gender; //性别
    String idNo; //身份证号
    String cardNo; //会员卡号
    Date lastLoginTime; //上次登录时间
    String mail; //电子邮件
    Integer balance; //余额(分)
    Integer exchangeBalance; //换电金额(分)
    Integer activeFlag; //是否启用
    String batteryForegiftOrderId; //电池押金订单id
    String oldBatteryForegiftOrderId; //之前电池押金订单id
    Integer foregift; //押金
    String openId;
    String modules;
    Integer level;
    Date createTime; //创建时间
    Integer addressBookId;
    String pushClientId;

    String bicycleId;
    String batteryId;
    // 新增：左外连接查询用
    @Transient
    String agentName,agencyName;
//    @Transient
//    Integer time;
//
//    public Integer getTime() {
//        return time;
//    }
//
//    public void setTime(Integer time) {
//        this.time = time;
//    }

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public String getAgencyName() {
        return agencyName;
    }

    public void setAgencyName(String agencyName) {
        this.agencyName = agencyName;
    }

    public String getBatteryForegiftOrderId() {
        return batteryForegiftOrderId;
    }

    public void setBatteryForegiftOrderId(String batteryForegiftOrderId) {
        this.batteryForegiftOrderId = batteryForegiftOrderId;
    }

    public String getOldBatteryForegiftOrderId() {
        return oldBatteryForegiftOrderId;
    }

    public void setOldBatteryForegiftOrderId(String oldBatteryForegiftOrderId) {
        this.oldBatteryForegiftOrderId = oldBatteryForegiftOrderId;
    }

    public Integer getForegift() {
        return foregift;
    }

    public void setForegift(Integer foregift) {
        this.foregift = foregift;
    }

    public String getBicycleId() {
        return bicycleId;
    }

    public void setBicycleId(String bicycleId) {
        this.bicycleId = bicycleId;
    }

    public String getBatteryId() {
        return batteryId;
    }

    public void setBatteryId(String batteryId) {
        this.batteryId = batteryId;
    }

    public String getPushClientId() {
        return pushClientId;
    }

    public void setPushClientId(String pushClientId) {
        this.pushClientId = pushClientId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPortrait() {
        return portrait;
    }

    public void setPortrait(String portrait) {
        this.portrait = portrait;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getIdNo() {
        return idNo;
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public Integer getBalance() {
        return balance;
    }

    public void setBalance(Integer balance) {
        this.balance = balance;
    }

    public Integer getExchangeBalance() {
        return exchangeBalance;
    }

    public void setExchangeBalance(Integer exchangeBalance) {
        this.exchangeBalance = exchangeBalance;
    }

    public Integer getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(Integer activeFlag) {
        this.activeFlag = activeFlag;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getModules() {
        return modules;
    }

    public void setModules(String modules) {
        this.modules = modules;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getAddressBookId() {
        return addressBookId;
    }

    public void setAddressBookId(Integer addressBookId) {
        this.addressBookId = addressBookId;
    }
}
